Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/model/src/commonMain/kotlin/org/meshtastic/core/model/RadioController.kt 9468bc6ebe7d423387a4f61d81986199443b43b3 (9468bc6e) Text, 11.46 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model

Tff7b72import T7ee787kotlinx.coroutines.flow.StateFlow
Tff7b72import T7ee787org.meshtastic.proto.ClientNotification

T8b949e/**
* Central interface for controlling the radio and mesh network.
*
* This component provides an abstraction over the underlying communication transport (e.g., BLE, Serial, TCP) and the
* low-level mesh protocols. It allows feature modules to interact with the mesh without needing to know about
* platform-specific service details or AIDL interfaces.
*/
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffTooManyFunctionsTa5d6ff"Tb4b4b4)
Tff7b72interface T56d364RadioController Tb4b4b4{
T8b949e/**
* Canonical app-level connection state, delegated from [ServiceRepository][connectionState].
*
* This exposes the same single source of truth as `ServiceRepository.connectionState`, surfaced through the
* controller interface for convenience in feature modules and ViewModels that depend on [RadioController] rather
* than [ServiceRepository] directly.
*
* This is **not** the transport-level state — it reflects the fully reconciled app-level state including handshake
* progress and device sleep policy.
*/
Tff7b72val Te6edf3connectionStateTb4b4b4: Te6edf3StateFlowTff7b72<Te6edf3ConnectionStateTff7b72>

T8b949e/**
* Flow of notifications from the radio client.
*
* These represent high-level events like "Handshake completed" or "Channel configuration updated."
*/
Tff7b72val Te6edf3clientNotificationTb4b4b4: Te6edf3StateFlowTff7b72<Te6edf3ClientNotification?Tff7b72>

T8b949e/**
* Sends a data packet to the mesh.
*
* @param packet The [DataPacket] containing the payload and routing information.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsendMessageTb4b4b4(Te6edf3packetTb4b4b4: Te6edf3DataPacketTb4b4b4)

T8b949e/** Clears the current [clientNotification]. */
Tff7b72fun Td2a8ffclearClientNotificationTb4b4b4(Tb4b4b4)

T8b949e/**
* Toggles the favorite status of a node on the radio.
*
* @param nodeNum The node number to favorite/unfavorite.
*/
Tff7b72suspend Tff7b72fun Td2a8fffavoriteNodeTb4b4b4(Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Sends our shared contact information (identity and public key) to the firmware's NodeDB.
*
* This ensures the firmware has the correct public key for the destination node before a PKI-encrypted direct
* message is sent. The method suspends until the radio acknowledges the admin packet.
*
* @param nodeNum The destination node number.
* @return `true` if the radio accepted the contact, `false` on timeout or failure.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsendSharedContactTb4b4b4(Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4)Tb4b4b4: Tffa657Boolean

T8b949e/**
* Updates the local radio configuration.
*
* @param config The new configuration [org.meshtastic.proto.Config].
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetLocalConfigTb4b4b4(Te6edf3configTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3ConfigTb4b4b4)

T8b949e/**
* Updates a local radio channel.
*
* @param channel The channel configuration [org.meshtastic.proto.Channel].
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetLocalChannelTb4b4b4(Te6edf3channelTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3ChannelTb4b4b4)

T8b949e/**
* Updates the owner (user info) on a remote node.
*
* @param destNum The destination node number.
* @param user The new user info [org.meshtastic.proto.User].
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetOwnerTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3userTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3UserTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Updates the general configuration on a remote node.
*
* @param destNum The destination node number.
* @param config The new configuration [org.meshtastic.proto.Config].
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetConfigTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3configTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3ConfigTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Updates a module configuration on a remote node.
*
* @param destNum The destination node number.
* @param config The new module configuration [org.meshtastic.proto.ModuleConfig].
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetModuleConfigTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3configTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3ModuleConfigTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Updates a channel configuration on a remote node.
*
* @param destNum The destination node number.
* @param channel The new channel configuration [org.meshtastic.proto.Channel].
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetRemoteChannelTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3channelTb4b4b4: Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3protoTb4b4b4.Te6edf3ChannelTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Sets a fixed position on a remote node.
*
* @param destNum The destination node number.
* @param position The position to set.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetFixedPositionTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3positionTb4b4b4: Te6edf3PositionTb4b4b4)

T8b949e/**
* Updates the notification ringtone on a remote node.
*
* @param destNum The destination node number.
* @param ringtone The name/ID of the ringtone.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetRingtoneTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3ringtoneTb4b4b4: Tffa657StringTb4b4b4)

T8b949e/**
* Updates the canned messages configuration on a remote node.
*
* @param destNum The destination node number.
* @param messages The canned messages string.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsetCannedMessagesTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3messagesTb4b4b4: Tffa657StringTb4b4b4)

T8b949e/**
* Requests the current owner (user info) from a remote node.
*
* @param destNum The remote node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetOwnerTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests a specific configuration section from a remote node.
*
* @param destNum The remote node number.
* @param configType The numeric type of the configuration section.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetConfigTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3configTypeTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests a module configuration section from a remote node.
*
* @param destNum The remote node number.
* @param moduleConfigType The numeric type of the module configuration section.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetModuleConfigTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3moduleConfigTypeTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests a specific channel configuration from a remote node.
*
* @param destNum The remote node number.
* @param index The channel index.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetChannelTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3indexTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests the current ringtone from a remote node.
*
* @param destNum The remote node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetRingtoneTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests the current canned messages from a remote node.
*
* @param destNum The remote node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetCannedMessagesTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests the hardware connection status from a remote node.
*
* @param destNum The remote node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetDeviceConnectionStatusTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Commands a node to reboot.
*
* @param destNum The target node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrebootTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Commands a node to reboot into DFU (Device Firmware Update) mode.
*
* @param nodeNum The target node number.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrebootToDfuTb4b4b4(Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Initiates an Over-The-Air (OTA) reboot request.
*
* @param requestId The request ID.
* @param destNum The target node number.
* @param mode The OTA mode.
* @param hash Optional hash for verification.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrequestRebootOtaTb4b4b4(Te6edf3requestIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3modeTb4b4b4: Tffa657IntTb4b4b4, Te6edf3hashTb4b4b4: Te6edf3ByteArray?Tb4b4b4)

T8b949e/**
* Commands a node to shut down.
*
* @param destNum The target node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8ffshutdownTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Performs a factory reset on a node.
*
* @param destNum The target node number.
* @param packetId The request packet ID.
*/
Tff7b72suspend Tff7b72fun Td2a8fffactoryResetTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Resets the NodeDB on a node.
*
* @param destNum The target node number.
* @param packetId The request packet ID.
* @param preserveFavorites Whether to keep favorite nodes in the database.
*/
Tff7b72suspend Tff7b72fun Td2a8ffnodedbResetTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3preserveFavoritesTb4b4b4: Tffa657BooleanTb4b4b4)

T8b949e/**
* Removes a node from the mesh by its node number.
*
* @param packetId The request packet ID.
* @param nodeNum The node number to remove.
*/
Tff7b72suspend Tff7b72fun Td2a8ffremoveByNodenumTb4b4b4(Te6edf3packetIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3nodeNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests the current GPS position from a remote node.
*
* @param destNum The target node number.
* @param currentPosition Our current position to provide in the request.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrequestPositionTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3currentPositionTb4b4b4: Te6edf3PositionTb4b4b4)

T8b949e/**
* Requests detailed user info from a remote node.
*
* @param destNum The target node number.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrequestUserInfoTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Initiates a traceroute request to a remote node.
*
* @param requestId The request ID.
* @param destNum The destination node number.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrequestTracerouteTb4b4b4(Te6edf3requestIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests telemetry data from a remote node.
*
* @param requestId The request ID.
* @param destNum The destination node number.
* @param typeValue The numeric type of telemetry requested.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrequestTelemetryTb4b4b4(Te6edf3requestIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4, Te6edf3typeValueTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Requests neighbor information (detected nodes) from a remote node.
*
* @param requestId The request ID.
* @param destNum The destination node number.
*/
Tff7b72suspend Tff7b72fun Td2a8ffrequestNeighborInfoTb4b4b4(Te6edf3requestIdTb4b4b4: Tffa657IntTb4b4b4, Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Signals the start of a batch configuration session.
*
* @param destNum The target node number.
*/
Tff7b72suspend Tff7b72fun Td2a8ffbeginEditSettingsTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Commits all pending configuration changes in a batch session.
*
* @param destNum The target node number.
*/
Tff7b72suspend Tff7b72fun Td2a8ffcommitEditSettingsTb4b4b4(Te6edf3destNumTb4b4b4: Tffa657IntTb4b4b4)

T8b949e/**
* Generates a unique packet ID for a new request.
*
* @return A unique 32-bit integer.
*/
Tff7b72fun Td2a8ffgetPacketIdTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Int

T8b949e/** Starts providing the phone's location to the mesh. */
Tff7b72fun Td2a8ffstartProvideLocationTb4b4b4(Tb4b4b4)

T8b949e/** Stops providing the phone's location to the mesh. */
Tff7b72fun Td2a8ffstopProvideLocationTb4b4b4(Tb4b4b4)

T8b949e/**
* Changes the device address (e.g., BLE MAC, IP address) we are communicating with.
*
* @param address The new device identifier.
*/
Tff7b72fun Td2a8ffsetDeviceAddressTb4b4b4(Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4)
Tb4b4b4}

Served by rngit 1.5.2 - Generated in 0.08s